import Title from "antd/lib/typography/Title";
import {Button, Space} from "antd";
import {useCallback} from "react";
import request from "umi-request";

function Index() {
  const getData = useCallback(() => {
    request.get('/api/user').then(res => {
      console.log(res);
    })
  }, []);

  const getData2 = useCallback(() => {
    request.get('/api/notices').then(res => {
      console.log(res);
    })
  }, []);

  return (
   <div>
     <Title>你好啊</Title>
     <Space>
       <Button type="primary" onClick={()=>{
         getData();
       }}>Primary Button</Button>
       <Button type="primary" onClick={()=>{
         getData2();
       }}>notices</Button>
     </Space>
   </div>
  )
}

export default Index;
